/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 小梅就是酱子
 * Date: 2022-02-04
 * Time: 16:22
 */
public class 顺序查找 {
    public static void main(String[] args) {
        int[] array={1,2,3,4,6};
        System.out.println(searchNumber(array,5));
    }
    public static int searchNumber(int[] array,int i){
        for(int a=0;a< array.length;a++){
            if(array[a]==i){
                return a;
            }
        }
        return -1;
    }
}
